package com.monlyu.action.manuscript;

import java.util.List;

import com.monlyu.action.PageAction;
import com.monlyu.bo.ManuscriptBo;
import com.monlyu.bean.Pages;
import com.monlyu.model.SearchManuscriptModel;
import com.monlyu.vo.Manuscript;

/*******************************************************************************
 * 
 * <b>功能描述☞</b><br>
 * 
 * <b>项目名☞</b>NewsSys<br>
 * <b>文件路径☞</b>com.monlyu.action.manuscript.ListManuscriptAction.java<br>
 * <b>开发日期☞</b>2010-2-28 <br>
 * 
 * @author skw
 * @since JDK 5
 * @version 1.0.1
 * 
 ******************************************************************************/
public class ListManuscriptAction extends PageAction {

	private ManuscriptBo manuscriptBo;
	private Pages<Manuscript> manuscripts;
	private SearchManuscriptModel searchManuscriptModel;
	private List<Manuscript> manuscriptsList;

	public String execute() {
		manuscripts = manuscriptBo.getManuscripts(getDefPage());
		return view("manuscriptList.jsp");
	}

	public String listEdit() {
		manuscripts = manuscriptBo.getEditable(getDefPage());
		return view("manuscriptList.jsp");
	}

	public String listDone() {
		manuscripts = manuscriptBo.getDoneEditable(getDefPage());
		return view("manuscriptList.jsp");
	}

	public String searchManus() {
		if (searchManuscriptModel != null) {
			manuscriptsList = manuscriptBo
					.getManuscriptByModel(searchManuscriptModel);
		}
		return view("manusQuery.jsp");
	}

	/**
	 * 查看稿件修改记录
	 * 
	 * @return
	 * @since chendan 2010-3-25
	 */
	public String searchManusHistory() {
		if (searchManuscriptModel != null) {
			manuscriptsList = manuscriptBo
					.getManuscriptByModel(searchManuscriptModel);
		}
		return view("manusQueryHistory.jsp");
	}

	public List<Manuscript> getManuscriptsList() {
		return manuscriptsList;
	}

	public void setManuscriptsList(List<Manuscript> manuscriptsList) {
		this.manuscriptsList = manuscriptsList;
	}

	public ManuscriptBo getManuscriptBo() {
		return manuscriptBo;
	}

	public void setManuscriptBo(ManuscriptBo manuscriptBo) {
		this.manuscriptBo = manuscriptBo;
	}

	public Pages<Manuscript> getManuscripts() {
		return manuscripts;
	}

	public void setManuscripts(Pages<Manuscript> manuscripts) {
		this.manuscripts = manuscripts;
	}

	public SearchManuscriptModel getSearchManuscriptModel() {
		return searchManuscriptModel;
	}

	public void setSearchManuscriptModel(
			SearchManuscriptModel searchManuscriptModel) {
		this.searchManuscriptModel = searchManuscriptModel;
	}

}
